10. Price Analysis Using the GBM Model
PRDTM2-787 AI Trading C4 L3 Vid9 Price Analysis Using The GBM Model
Using Geometric Brownian Motion for Stock Price Analysis
Learn to create a function to analyze stock prices and advise actions. This involves the following steps:
Data Preparation
- Historical Price Table: Contains two columns - "Day" for the date and "Closing Price."
- Primary Key: The "Day" column ensures unique daily price entries.
The analyze Function
- Goal: Calibrate the model for a specific date and forecast future stock prices.
- Argument: The function takes
which_dayas input to perform analysis. - Data Fetching: Retrieve the latest 120 daily closing prices.
Analysis Process
- Model Initialization: Declare a Geometric Brownian Motion (GBM) model.
- Calibration: Tune model parameters using historical data within the lookback window.
- Forecasting: Predict stock prices 10 days ahead with varying confidence levels.
- Risk Management: Calculate expected shortfall for a 10-day period, aiding in risk assessment.
- Decision Making: Output determines whether to buy, sell, or hold shares.